#ifndef B2D_IGRAPHICSRESOURCE_H
#define B2D_IGRAPHICSRESOURCE_H

#include "Prerequisites.h"

NS_B2D_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief	Interface for graphics hardware resources allows notification of context loss.
/// 		Default behaviour is to do nothing.
////////////////////////////////////////////////////////////////////////////////////////////////////
class B2D_API IGraphicsResource
{
	B2D_INTERFACE(IGraphicsResource)

public:
	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// \brief	Executes the context lost action.
	/// 		Called when the graphics context is about to be lost.
	/// 		Data should be saved in order to recreate when the context is recovered
	////////////////////////////////////////////////////////////////////////////////////////////////////
	virtual void onContextLost(void) { }
	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// \brief	Executes the context recreated action.
	/// 		Called after the graphics context has been recreated.
	/// 		Resources must be recreated in the graphics card.
	////////////////////////////////////////////////////////////////////////////////////////////////////
	virtual void onContextRecreated(void) { }
};

NS_B2D_END

#endif